The Buffering and Input/Output Preferences ('iobm') Resource
The buffering and input/output preferences ('iobm'
) resource, of typegxUniveralIOPrefsType
, defines the timeout and buffering parameters for the driver. This resource is optional; if you do not supply one, QuickDraw GX uses standard I/O with two buffers, each 1 KB long, and defines each timeout value to be 10 seconds. Figure 6-20 shows the structure of the buffering and input/output preferences resource.Figure 6-20 The buffering and input/output preferences resource
The buffering and input/output preferences resource defines the buffering and timeout values for I/O.
- Type of I/O. The type of I/O to use. This is one of two values:
standardIO
orcustomIO
. If you specifycustomIO
, it means that your driver is handling input and output communications without using the built-in support.
- Note
- SCSI drivers must use the
customIO
value in this field. QuickDraw GX does not provide a default implementation of SCSI connections. If you do develop a SCSI driver, you must override the device communications messages and manage all of the communications yourself.![]()
The buffering and input/output preferences resource ID needs to be the constant gxUniversalIOPrefsID. Listing 6-18 shows an example of a buffering and
- Number of buffers. The number of buffers to create for this driver.
- Buffer size. The size of each buffer.
- Number of pending requests. The maximum number of input or output requests that can be pending at any time.
- Open/close timeout. The number of clock ticks that constitute a timeout when trying to open or close the device.
- Read/write timeout. The number of clock ticks that constitute a timeout when trying to read from or write to the device.
input/output preferences resource.Listing 6-18 An example of a buffering and input/output preferences resource
resource gxUniveralIOPrefsType (gxUniversalIOPrefsID, sysHeap, purgeable) { standardIO, 4, /* 4 buffers */ 2048, /* each buffer 2 KB */ 10, /* up to 10 I/O operations pending */ 1200, /* open/close timeout of 1200 clock ticks */ 1200 /* read/write timeout of 1200 clock ticks */ }; };This resource is for the ImageWriter II printer driver, which uses four buffers, each
2 KB long. Ten request blocks will be allocated for communications with this device,
and requests to open, close, read, or write the device will time out in 1200 clock ticks
(20 seconds).
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help